﻿namespace GX
{
    static public class StringExt
    {
        static public int GetInt(this string s)
        {
            int v;
            if (int.TryParse(s, out v))
                return v;
            return 0;
        }
        static public float GetFloat(this string s)
        {
            float v;
            if (float.TryParse(s, out v))
                return v;
            return 0f;
        }
        static public bool GetBool(this string s)
        {
            bool v;
            if (bool.TryParse(s, out v))
                return v;
            return false;
        }
    }
}